//
//  TopicInfoService.m
//  TipsProject
//
//  Created by Suny on 15/5/18.
//  Copyright (c) 2015年 Suny. All rights reserved.
//

#import "TopicInfoService.h"

@implementation TopicInfoService


- (void)getTopicListWithFinishBlock:(RequestFinishBlock)finishBlock
{
	
	WEAKSELF;		
	AFHTTPRequestOperation * requestOperation = [self beginGetRequestWithRelativePath:kGetTopicList
																	  parameterObject:nil
																		responseClass:nil
																		  finishBlock:^(BaseResponse *response) {
																			  [weakSelf removeWrapperForKey:kGetTopicList];
																			  
																			  
																			  NSMutableArray *objectArray = [NSMutableArray array];
																			  for (NSDictionary * dic in response.object) 
																			  {
																				  TopicInfo *info = [[TopicInfo alloc] initWithSourceString:dic];
																				  
																				  TopicTableDisplayInfo *displayInfo = [[TopicTableDisplayInfo alloc] initWithModelInfo:info];
																				  [objectArray addObject:displayInfo];
																			  }
																			  
																			  response.object = objectArray;

																			  finishBlock(response);
																			  
																		  }];
	
	
	
	
	[self setWrapper:requestOperation
			  ForKey:kGetTopicList];
	
}





@end
